﻿<div id="grid" style="margin-left:1%;"></div>

<script type="text/javascript">
    $(document).ready(function () {
        $('#grid').ligerGrid({
            title: '审批历史记录',
            rownumbers: true,
            resizable: false,
            frozen: false,
            height: '98%',
            width: '98%',
            columns: [
                {
                    name: 'flowname', display: '审批流程名称', width: 200,
                    render: function (item) {
                        return '<a href="/Item/Info?id=' + item.flowobjectid + '" target="_self">' + item.flowname + '</a>';
                    }
                }
                , {
                    name: 'flowstate', display: '流程状态', width: 100,
                    render: function (item) {
                        switch (item.flowstate) {
                            case 1:
                                return '进行中';
                            case 2:
                                return '暂停';
                            case 3:
                                return '结束-通过';
                            case 4:
                                return '结束-未通过';
                            default:
                                return '已关闭';
                        }
                    }
                }
                , { name: 'username', display: '申请人', width: 100 }
                , { name: 'dept', display: '申请部门', width: 100 }
                , { name: 'creationtime', display: '申请时间', width: 120 }
                , {
                    name: 'state', display: '审批状态', width: 80,
                    render: function (item) {
                        switch (item.state) {
                            //0 关闭 1 初始 2 通过 3 拒绝 4 指派 5 跳过
                            case 0:
                                return '关闭';
                            case 1:
                                return '进行中';
                            case 2:
                                return '通过';
                            case 3:
                                return '拒绝';
                            case 4:
                                return '指派';
                            case 5:
                                return '跳过';
                        }

                        return '&nbsp;';
                    }
                }
                , { name: 'updatedtime', display: '审批时间', width: 120 }
                , { name: 'result', display: '审批意见', width: 350 }
            ],
            url: '/Work/GetHistories'
        });
    });
</script>